home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Personal Computer World 2009 February
/
PCWFEB09.iso
/
Software
/
Resources
/
Browsers, Managers & Extensions
/
Firefox Backup Extension 6.0.3
/
chrome
/
febe.jar
/
content
/
febeHelp.js
< prev
next >
Wrap
Text File
|
2008-08-17
|
11KB
|
284 lines
// author: Chuck Baker
// contact: febe@customsoftwareconsult.com
// Version 6.0
function febeLoadHelp(){
var index = window.arguments[0];
var field = window.arguments[1];
const HTMLNS = "http://www.w3.org/1999/xhtml";
document.getElementById("field").value = field;
var fh = document.getElementById('febe-help');
var helpTxt = fh.getString("febe.help_"+index+".text1");
// XUL pallette
var desc = document.createElement('description');
desc.setAttribute('flex', "1");
var separator = document.createElement('separator');
separator.setAttribute('class', "thin");
var vbox = document.createElement('vbox');
var hbox = document.createElement('hbox');
var grid = document.createElement('grid');
var columns = document.createElement('columns');
var column = document.createElement('column');
var rows = document.createElement('rows');
var row = document.createElement('row');
var spacer = document.createElement('spacer');
spacer.setAttribute('flex', "1");
var image = document.createElement('image');
var label = document.createElement('label');
var text = document.createElement('text');
// HTML namespace elements
var htmlul = document.createElementNS(HTMLNS, "html:ul");
var htmlli = document.createElementNS(HTMLNS, "html:li");
var helpTxtbox = document.getElementById('helptextbox');
//helpTxtbox.appendChild(desc);
switch(index){
case "01": case "10": // Two lines of text
helpTxt = fh.getString("febe.help_"+index+".text1");
febeAddTxtHelpLine(helpTxtbox,helpTxt);
helpTxtbox.appendChild(separator);
helpTxt = fh.getString("febe.help_"+index+".text2");
febeAddTxtHelpLine(helpTxtbox,helpTxt);
break;
case "03": case "04": case "28": // Three lines of text
helpTxt = fh.getString("febe.help_"+index+".text1");
febeAddTxtHelpLine(helpTxtbox,helpTxt);
helpTxtbox.appendChild(separator);
helpTxt = fh.getString("febe.help_"+index+".text2");
febeAddTxtHelpLine(helpTxtbox,helpTxt);
helpTxt = fh.getString("febe.help_"+index+".text3");
febeAddTxtHelpLine(helpTxtbox,helpTxt);
break;
case "05": case "99": // Restore profile
helpTxt = fh.getString("febe.help_05.text1").replace("%LINK%","");
var desc = desc.cloneNode(false);
desc.appendChild(document.createTextNode(helpTxt));
var text = text.cloneNode(false);
text.setAttribute('value', "http://kb.mozillazine.org/Profile_Manager");
text.setAttribute('class', "link");
text.setAttribute('onclick', "febeOpenLink('http://kb.mozillazine.org/Profile_Manager');");
desc.appendChild(text);
helpTxtbox.appendChild(desc);
if(index == "99"){ // Restore profile error message
helpTxtbox.appendChild(separator);
var desc = desc.cloneNode(false);
helpTxt = fh.getString("febe.help_99.text1");
var text = text.cloneNode(false);
text.setAttribute('value', helpTxt);
text.setAttribute('class', "font12");
desc.appendChild(text);
helpTxt = fh.getString("febe.help_99.text2")+" "+fh.getString("febe.help_99.text3")+" ";
desc.appendChild(document.createTextNode(helpTxt));
var linkTxt = fh.getString("febe.help_99.text4");
var text = text.cloneNode(false);
text.setAttribute('class', "link");
text.setAttribute('value', linkTxt);
text.setAttribute('onclick', "febeOpenLink('http://www.customsoftwareconsult.com/phpBB2/viewtopic.php?t=593');");
desc.appendChild(text);
helpTxt = " "+fh.getString("febe.help_99.text5");
var text = text.cloneNode(false);
text.setAttribute('value', helpTxt);
text.removeAttribute('class');
text.removeAttribute('onclick');
desc.appendChild(text);
helpTxtbox.appendChild(desc);
}//if
break;
case "07":
var htmlul = htmlul.cloneNode(false);
var htmlli = htmlli.cloneNode(false);
var image = image.cloneNode(false);
image.setAttribute('src', "chrome://febe/skin/play.png");
image.setAttribute('style', "cursor: pointer");
var tooltip = fh.getString("febe.help_"+index+".text7");
image.setAttribute('tooltiptext', tooltip);
helpTxt = fh.getString("febe.help_"+index+".text1");
febeAddTxtHelpLine(helpTxtbox,helpTxt);
helpTxt = fh.getString("febe.help_"+index+".text2")+" ";
var htmlli = htmlli.cloneNode(false);
htmlli.appendChild(document.createTextNode(helpTxt));
var image = image.cloneNode(true);
image.setAttribute('onclick', "febePlaySoundHelp('success');");
htmlli.appendChild(image);
htmlul.appendChild(htmlli);
helpTxt = fh.getString("febe.help_"+index+".text3")+" ";
var htmlli = htmlli.cloneNode(false);
htmlli.appendChild(document.createTextNode(helpTxt));
var image = image.cloneNode(true);
image.setAttribute('onclick', "febePlaySoundHelp('failure');");
htmlli.appendChild(image);
htmlul.appendChild(htmlli);
helpTxt = fh.getString("febe.help_"+index+".text4")+" ";
var htmlli = htmlli.cloneNode(false);
htmlli.appendChild(document.createTextNode(helpTxt));
var image = image.cloneNode(true);
image.setAttribute('onclick', "febePlaySoundHelp('warning');");
htmlli.appendChild(image);
htmlul.appendChild(htmlli);
helpTxt = fh.getString("febe.help_"+index+".text5")+" ";
var htmlli = htmlli.cloneNode(false);
htmlli.appendChild(document.createTextNode(helpTxt));
var image = image.cloneNode(true);
image.setAttribute('onclick', "febePlaySoundHelp('alert');");
htmlli.appendChild(image);
htmlul.appendChild(htmlli);
helpTxt = fh.getString("febe.help_"+index+".text6")+" ";
var htmlli = htmlli.cloneNode(false);
htmlli.appendChild(document.createTextNode(helpTxt));
var image = image.cloneNode(true);
image.setAttribute('onclick', "febePlaySoundHelp('help');");
htmlli.appendChild(image);
htmlul.appendChild(htmlli);
vbox.appendChild(htmlul);
helpTxtbox.appendChild(vbox);
break;
case "09":
var hbox = hbox.cloneNode(false);
var desc = desc.cloneNode(false);
helpTxt = fh.getString("febe.help_"+index+".text1")
desc.appendChild(document.createTextNode(helpTxt));
hbox.appendChild(desc);
helpTxtbox.appendChild(hbox);
var separator = separator.cloneNode(true);
helpTxtbox.appendChild(separator);
//<grid>
var grid = grid.cloneNode(false);
var columns = columns.cloneNode(false);
var column = column.cloneNode(false);
columns.appendChild(column);
var column = column.cloneNode(false);
column.setAttribute('flex', "1");
columns.appendChild(column);
grid.appendChild(columns);
var rows = rows.cloneNode(false);
var row = row.cloneNode(false);
var image = image.cloneNode(false);
image.setAttribute('style', "max-width: 16px; max-height: 16px");
image.setAttribute('src', "chrome://febe/skin/febeYesBU.png");
var desc = desc.cloneNode(false);
helpTxt = fh.getString("febe.help_"+index+".text2")
desc.appendChild(document.createTextNode(helpTxt));
row.appendChild(image);
row.appendChild(desc);
rows.appendChild(row);
var row = row.cloneNode(false);
var image = image.cloneNode(false);
image.setAttribute('style', "max-width: 16px; max-height: 16px");
image.setAttribute('src', "chrome://febe/skin/febeNoBU.png");
var desc = desc.cloneNode(false);
helpTxt = fh.getString("febe.help_"+index+".text3")
desc.appendChild(document.createTextNode(helpTxt));
row.appendChild(image);
row.appendChild(desc);
rows.appendChild(row);
var row = row.cloneNode(false);
var image = image.cloneNode(false);
image.setAttribute('style', "max-width: 16px; max-height: 16px");
image.setAttribute('src', "chrome://febe/skin/febeWarning.gif");
var desc = desc.cloneNode(false);
helpTxt = fh.getString("febe.help_"+index+".text4")
desc.appendChild(document.createTextNode(helpTxt));
row.appendChild(image);
row.appendChild(desc);
rows.appendChild(row);
grid.appendChild(rows);
helpTxtbox.appendChild(grid);
var separator = separator.cloneNode(true);
helpTxtbox.appendChild(separator);
var desc = desc.cloneNode(false);
helpTxt = fh.getString("febe.help_"+index+".text5")
desc.appendChild(document.createTextNode(helpTxt));
helpTxtbox.appendChild(desc);
break;
case "11":
helpTxt = fh.getString("febe.help_"+index+".text1");
febeAddTxtHelpLine(helpTxtbox,helpTxt);
helpTxtbox.appendChild(spacer);
var desc = desc.cloneNode(false);
var hbox = hbox.cloneNode(false);
var label = label.cloneNode(false);
helpTxt = fh.getString("febe.help_"+index+".text2");
label.setAttribute('value', helpTxt);
var image = image.cloneNode(false);
image.setAttribute('class', "helpButton");
hbox.appendChild(label);
hbox.appendChild(separator);
hbox.appendChild(image);
desc.appendChild(hbox);
helpTxtbox.appendChild(desc);
helpTxt = fh.getString("febe.help_"+index+".text3");
febeAddTxtHelpLine(helpTxtbox,helpTxt);
break;
case "21":
for(var i=1; i<11; i++){
helpTxt = fh.getString("febe.help_"+index+".text"+i);
febeAddTxtHelpLine(helpTxtbox,helpTxt);
}//for
break;
case "29":
for(var i=1; i<4; i++){
helpTxt = fh.getString("febe.help_"+index+".text"+i);
febeAddTxtHelpLine(helpTxtbox,helpTxt);
}//for
helpTxt = fh.getString("febe.help_"+index+".text4");
var desc = desc.cloneNode(false);
desc.setAttribute('style', "font-weight: bold;");
desc.appendChild(document.createTextNode(helpTxt));
helpTxtbox.appendChild(desc);
var separator = separator.cloneNode(true);
helpTxtbox.appendChild(separator);
helpTxt = fh.getString("febe.help_"+index+".text5")+" ";
var desc = document.createElement('description');
desc.setAttribute('flex', "1");
desc.appendChild(document.createTextNode(helpTxt));
var linkTxt = fh.getString("febe.help_"+index+".text6");
var text = text.cloneNode(false);
text.setAttribute('class', "link");
text.setAttribute('value', linkTxt);
text.setAttribute('onclick', "febeOpenLink('http://www.jdoqocy.com/click-3044448-10490221');");
desc.appendChild(text);
helpTxtbox.appendChild(desc);
break;
default:
helpTxt = fh.getString("febe.help_"+index+".text1");
febeAddTxtHelpLine(helpTxtbox,helpTxt);
break;
}//switch
febePlaySound("help");
return true;
}//febeLoadHelp()
function febeAddTxtHelpLine(box,txt){
var desc = document.createElement('description');
desc.setAttribute('flex', "1");
desc.appendChild(document.createTextNode(txt));
box.appendChild(desc);
var separator = document.createElement('separator');
separator.setAttribute('class', "thin");
box.appendChild(separator);
}//febeAddTxtHelpLine()